<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.1"
                xmlns:iring="http://ns.iringtools.org/library"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text" encoding="UTF-8" omit-xml-declaration="yes"/>
  <xsl:variable name="namespace" select="'org.ids_adi.iring.adapter'"/>
  
  <xsl:template match="/">
    <xsl:apply-templates select="Mapping"/>
  </xsl:template>

  <xsl:template match="Mapping">
//------------------------------------------------------------------------------
//
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//
//
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using <xsl:value-of select="$namespace"/>.dtoLayer;
using <xsl:value-of select="$namespace"/>.dtoLayer.Model;

namespace <xsl:value-of select="$namespace"/>
{
  [ServiceContract(Namespace = "http://ns.iringtools.org/protocol")]
  public interface IDataService
{
    <!--
    [OperationContract]<xsl:for-each select="GraphMaps/GraphMap">
    [ServiceKnownType(typeof(<xsl:value-of select="@name"/>DTO))]</xsl:for-each>
    [WebGet(UriTemplate = "/{graphName}/{identifier}")]
    CommonDTO GetDTO(string graphName, string identifier);

    [OperationContract]
    [WebGet(UriTemplate = "/{graphName}")]
    Dictionary&lt;string, string&gt; GetDTOList(string graphName);
    -->

    <xsl:for-each select="GraphMaps/GraphMap">
    [OperationContract]
    [WebGet(UriTemplate = "/<xsl:value-of select="@name"/>/{identifier}")]
    <xsl:value-of select="@name"/>DTO Get<xsl:value-of select="@name"/>DTO(string identifier);

    [OperationContract]
    [WebGet(UriTemplate = "/<xsl:value-of select="@name"/>")]
    Dictionary&lt;string, string&gt; Get<xsl:value-of select="@name"/>DTOList();

    [OperationContract]
    <xsl:value-of select="@name"/>Response Get<xsl:value-of select="@name"/>(Identifier identifier);

    [OperationContract]
    <xsl:value-of select="@name"/>ListResponse Get<xsl:value-of select="@name"/>List();    
    </xsl:for-each>
  }
  
  [MessageContract(IsWrapped = true)]
  public class Identifier
  {
    [MessageBodyMember]
    public string value;
  }    
  
  <xsl:for-each select="GraphMaps/GraphMap">      
  [MessageContract(IsWrapped = true)]
  public class <xsl:value-of select="@name"/>Response
  {
    [MessageBodyMember]
    public <xsl:value-of select="@name"/>DTO dto;
  }

  [MessageContract(IsWrapped = true)]
  public class <xsl:value-of select="@name"/>ListResponse
  {
    [MessageBodyMember]
    public List&lt;<xsl:value-of select="@name"/>DTO&gt; dtoList;
  }
  </xsl:for-each>  
} </xsl:template>
</xsl:stylesheet>